package com.tuozixuan;

import java.io.File;
import java.util.List;
import java.util.stream.Collectors;

public class FileResult {

	private File file;
	
	private List<LineResult> lineResultList;

	public File getFile() {
		return file;
	}

	public void setFile(File file) {
		this.file = file;
	}

	public List<LineResult> getLineResultList() {
		return lineResultList;
	}

	public void setLineResultList(List<LineResult> lineResultList) {
		this.lineResultList = lineResultList;
	}
	
	@Override
	public String toString() {
		
		String lineResults = lineResultList.stream().map(lineResult -> String.format("%s Line:%d   %s --> %s", 
				file.getName(), lineResult.getLineNo(), lineResult.getSourceLine(), lineResult.getTargetLine()))
				.collect(Collectors.joining("\r\n"));
		return lineResults;
	}
	
}
